﻿CREATE PROCEDURE [dbo].[ReportWeeklySummary]
@startDate DATETIME
AS
BEGIN
	SELECT        Users.FullName, Projects.Name, EntryLog.EntryDate, EntryLog.Description, EntryLog.Duration
	FROM            EntryLog INNER JOIN
							 Users ON EntryLog.UserID = Users.UserID INNER JOIN
							 Projects ON Projects.ProjectID = EntryLog.ProjectID
	WHERE        (EntryLog.EntryDate > @startDate) and (EntryLog.EntryDate < DATEADD(dd, 7, @startDate))
	ORDER BY Users.UserName, Projects.Name, EntryLog.EntryDate
END

